package com.huike.web.controller.report;

import com.huike.business.domain.TbBusiness;
import com.huike.common.core.controller.BaseController;
import com.huike.common.core.domain.AjaxResult;
import com.huike.common.core.page.TableDataInfo;
import com.huike.report.domain.service.IndexService;
import com.huike.report.domain.vo.IndexTodayInfoVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@Api("操作日志")
@Slf4j
@RequestMapping("/report")
@RestController
public class ReportController extends BaseController {

    @Resource
    private IndexService indexService;


//    @ApiOperation("获取今日简报")
//    @PreAuthorize("@ss.hasPermi('system:user:list')")
//    @GetMapping("/salesStatistics/getTodoInfo")
//    public AjaxResult list(@RequestParam("beginCreateTime") String beginCreateTime,
//                           @RequestParam("endCreateTime") String endCreateTime) {
//        IndexTodayInfoVO indexTodayInfoVO = indexService.getBaseInfo(beginCreateTime,endCreateTime);
//        return AjaxResult.success(indexTodayInfoVO);
//    }

    @ApiOperation("客户统计明细列表")
    @PreAuthorize("@ss.hasPermi('system:user:list')")
    @GetMapping("/contractStatisticsList")
    public TableDataInfo list(TbBusiness user){
        //startPage();
//        log.info("查询操作日志列表{}", list);
        startPage();
        log.info("存入的对象：{}", user);
        List<TbBusiness> list = indexService.selectUserList(user);
        log.info("存入的对象：{}", list);
        return getDataTable(list);
//        PageResult pageResult = indexService.contractStatisticsList(dto);
//        PageAjaxResult pageAjaxResult = PageAjaxResult.success();
//        pageAjaxResult.setRows(pageResult.getRecords());
//        pageAjaxResult.setTotal(pageResult.getTotal());
//        return pageAjaxResult;
    }


}
